const vm = new Vue({
    el: '#root',
    data() {
        return {
            name: '',
            arr: [],
        }
    },
    methods: {
        down() {
            let obj = { id: this.arr.length + 1, name: this.name, status: false }
            this.arr.push(obj)
            this.name = ''
        },
        sanyuan(item) {
            item.status = !item.status;
        },

        deleteRow(index) {
            let it = this.arr
            it.splice(index, 1);
        }
    },
    computed: {
        nowancheng() {
            let sum = 0;
            this.arr.forEach((item) => {
                if (item.status == false) {
                    sum++;
                }
            })
            return sum;
        },
    }
})